#pragma once
#include<string>
#include<thread>
#include<sstream>
class Utils {
public:

	static std::string hostname();

	static int pid()
	{
		return ::_getpid();
	}

    static std::string getTid() {
        std::ostringstream oss;
        oss << std::this_thread::get_id();
        return oss.str();
    }

    static std::string getTime()
    {
        time_t timep;
        time(&timep);
        char tmp[64];
        strftime(tmp, sizeof(tmp), "%Y-%m-%d %H:%M:%S", localtime(&timep));
        return tmp;
    }
};
